package com.zoweunion.mechanic.service.app;

import com.alibaba.fastjson.JSONObject;
import com.zoweunion.mechanic.model.ResponseBean;
import com.zoweunion.mechanic.model.User;
import com.zoweunion.mechanic.model.app.Region;
import com.zoweunion.mechanic.util.MyException;

import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;

public interface AppService {

	/**
	 * 创建工单
	 * @param reqMap
	 * @return
	 */
	public int createOrder(Map<String, Object> reqMap);
	/**
	 * 创建工单
	 * @param reqMap
	 * @return
	 */
	String createOrderNew(Map<String, Object> reqMap);

	void createOrderDetailParts(Object mId, String currentUserId, String order_id);

	//获取车辆列表
	public List<Map<String, Object>>  getVehicleList(Map<String, Object> reqMap);

	/**
	 * 获取故障类型
	 * @param reqMap
	 * @return
	 */
	public List<Map<String, Object>> getFaultInfo(Map<String, Object> reqMap);

	public List<Map<String, Object>>  getUpkeepInfo(Map<String, Object> reqMap);

	public List<Map<String, Object>>  getOrderInfo(User currentUser, Map<String, Object> reqMap);

	public ResponseBean updateOrderInfo(Map<String, Object> reqMap);




	public ResponseBean completeOrderInfo(Map<String, Object> reqMap);

	public ResponseBean returnRepair(Map<String, Object> reqMap);

	boolean saveOrderDiscount(User currentUser, Map<String, Object> reqMap) throws MyException;

	/**
	 * 删除司机
	 * @param reqObj
	 * @return
	 */
	public Boolean removeOwnerDriver(JSONObject reqObj);

	/**
	 * 车主绑定车辆和司机
	 * @param reqObj
	 * @return
	 */
	public int createOwnerCar(JSONObject reqObj) throws MyException;

	/**
	 * 获取车辆
	 * @param reqObj
	 * @return
	 */
	public Object getCarInfo(JSONObject reqObj) throws MyException;

	/**
	 * 车辆工时统计
	 * @param currentUser
	 * @param reqMap
	 * @return
	 */
	Map<String, Object> getCarWorkingHoursStatistics(User currentUser, Map<String, Object> reqMap) throws UnsupportedEncodingException;

	public Boolean isCorrectPassWord(String userId, String oldPassWord);

	public int updatePassWord(Map<String, Object> reqMap);

	public int updateOrderStatus(Map<String, Object> reqMap);

	public int updateUserInfo(Map<String, Object> reqMap);

	public Boolean addOwnerDriver(Map<String, Object> reqMap);

	/**
	 * 获取听诊修工信息
	 * @return
	 * @param reqObj
	 */
	public Object getWorker(JSONObject reqObj);

	/**
	 * 获取司机
	 * @param reqObj
	 * @return
	 */
	public Object getOwnerDriver(JSONObject reqObj);


	List<Map<String, Object>> province(Map<String, Object> reqMap);

	List<Map<String, Object>> city(Map<String, Object> reqMap);

	List<Map<String, Object>> area(Map<String, Object> reqMap);

	List<Region> getRegionIncludeProvinceAll(Map<String, Object> reqMap);

	List<Region> getRegionIncludeProvinceAllNew(Map<String, Object> reqMap);

	Map<String, Object> getTrajectory(Map<String, Object> reqMap);

	List<Region> getRegionIncludeProvinceSaleManagement(Map<String, Object> reqMap);

	List<Region> getRegionIncludeProvinceSaleManagementForCarOwner(Map<String, Object> reqMap);

	List<Map<String, Object>> provinceAll();

	List<Map<String, Object>> cityAll();

	List<Map<String, Object>> areaAll();

	Map<String, Object> getTrajectoryYD(Map<String, Object> reqMap);

	List<Map<String, Object>> getCarRecord(Map<String, Object> reqMap);

	int deleteHistorySearchTarget(Map<String, Object> reqMap);

	int addHistorySearchTarget(Map<String, Object> reqMap);

	Map<String, Object> getHistorySearchTarget(Map<String, Object> reqMap);

	Map<String, Object> carHistoricalData(Map<String, Object> reqMap) throws MyException;

	Map<String, Object> carHistoricalDataNew(Map<String, Object> reqMap) throws MyException;

	Map<String, Object> carHistoricalDataPC(Map<String, Object> reqMap) throws MyException;

	Map<String, Object> carHistoricalDataLine(Map<String, Object> reqMap) throws MyException;

	Map<String, Object> getMessage(Map<String, Object> reqMap);

	Integer getMessageFlagCount(Map<String, Object> reqMap);

	int updateMessage(Map<String, Object> reqMap);

	ResponseBean addEvaluate(Map<String, Object> reqMap) throws MyException;

	Map<String, Object> getEvaluate(Map<String, Object> reqMap) throws MyException;

	int updateLastCity(Map<String, Object> reqMap) throws MyException;

	Map<String, Object> getLastCity(Map<String, Object> reqMap) throws MyException;

	int scanAddDevice(Map<String, Object> reqMap) throws MyException;

	int getIsServerDevice(Map<String, Object> reqMap) throws MyException;

	Map<String, Object> getServer(Map<String, Object> reqMap) throws MyException;

	/**
	 * 为用户添加管辖区域
	 * @param provinceList
	 * @param userId
	 * @param sId
	 * @return
	 */
	boolean addUserAssignRegion(List<Map<String, Object>> provinceList, String staffId, String sId, String userId);
	/**
	 * 更新用户管辖区域
	 * @param provinceList
	 * @param userId
	 * @param sId
	 * @return
	 */
	boolean updateUserAssignRegion(List<Map<String, Object>> provinceList, String staffId, String sId, String userId);

	/**
	 * 获取用户信息和管辖区域
	 * @param userId
	 * @param sId
	 * @return
	 */
	Map<String, Object> getUserInfoAndAssignRegion(String userId, String sId);

	void deleteAssignRegionByUserId(String userId);

	/**
	 * 账号管理_查询车主信息
	 * @param userId
	 * @return
	 */
	Map<String, Object> getCarMasterInfo(String userId);

	/**
	 * 获取用户所有管辖区域，number号
	 * @param userId
	 * @param sId
	 * @return
	 */
	String[] getPrecinctRegionNumbers(String userId, String sId);

	/**
	 * 获取仓管所属仓库的所有管辖区域
	 * @param userId
	 * @return
	 */
	String[] getWarehouseRegions(String userId);

	void regeo();

    List<Map<String, Object>> getLockInfo(Map<String, Object> reqMap);

	int getLockInfoStatus(Map<String, Object> reqMap);

	List<Map<String, Object>> getOrderListByPayType(User currentUser, Map<String, Object> reqMap);

	void sendSMSRemind(User currentUser, Map<String, Object> reqMap);

	Map<String, Object> getUserTrid(User currentUser, Map<String, Object> reqMap) throws MyException;

	boolean saveUserTrid(User currentUser, Map<String, Object> reqMap) throws MyException;

	void updateHumanFaceAuthorization(Map<String, Object> reqMap) throws MyException;

	Map<String, Object> getHumanFaceId(Map<String, Object> reqMap) throws MyException;

	void deleteHumanFaceId(Map<String, Object> reqMap) throws MyException;

	List<Map<String, Object>> selectTemplateColumn(Map<String, Object> reqMap);

	List<Map<String, Object>> selectFaultData(Map<String, Object> reqMap);

    void trialApplication(Map<String, Object> reqMap);

	/**
	 * 根据UserId和SId查询出该人员下面负责区域数据,并把区域数据封装为tree结构
	 * @param userId
	 * @param sId
	 * @return
	 */
	List<Map<String, Object>> wrapTreeWithAssignRegionUserBySId(String sId, String userId);

	/**
	 * 根据应用名称查询应用的通用配置
	 * @param appName
	 * @return
	 */
	Map<String, Object> getAppPcSetting(String appName);


    List<Map<String, Object>> getAllCarInFinancialByOwnerId(String id);

	int applyUnlock(Map<String, Object> params);
}